<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/11/11 011
 * Time: 9:35
 */
namespace App\NewPizza;

class NYPizzaStore extends PizzaStore
{
    public function createPizza($item)
    {
        // TODO: Implement createPizza() method.
        $pizza = null;
        $ingredientFactory = new NYPizzaIngredientFactory();

        if($item == "cheese") {
            $pizza = new CheesePizza($ingredientFactory);
            $pizza->setName('New York Style Cheese Pizza');
        } else if($item == "clam") {
            $pizza = new ClamPizza($ingredientFactory);
            $pizza->setName('New York Style Clam Pizza');
        }

        return $pizza;
    }
}